package com.cbh.feign.controller.theorder;



import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.cbh.api.model.ApiResult;
import com.cbh.api.model.theorder.TheOrder;
import com.github.pagehelper.PageInfo;

public interface TheOrderControllerBase {

	@RequestMapping(value = "/sign/v3/theOrder/abandon", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<TheOrder> issue(@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "toId", required = true) String toId);

	@RequestMapping(value = "/sign/v3/theOrder", method = RequestMethod.POST, produces = "application/json")
	public ApiResult<TheOrder> generate(

			@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "toId", required = true) String toId,
			@RequestParam(value = "engineNo", required = false) String engineNo,

			@RequestParam(value = "vehicleLicensePage", required = true) String vehicleLicensePage,
			@RequestParam(value = "vehicleLicenseAttach", required = true) String vehicleLicenseAttach,
			@RequestParam(value = "vehicleLicenseValidPage", required = true) String vehicleLicenseValidPage,
			@RequestParam(value = "idCardPositive", required = true) String idCardPositive,
			@RequestParam(value = "idCardContrary", required = true) String idCardContrary,
			@RequestParam(value = "theBusinessLicense", required = false) String theBusinessLicense,
			@RequestParam(value = "organizationCodeCertificate", required = false) String organizationCodeCertificate,

			@RequestParam(value = "applicantAddress", required = true) String applicantAddress,
			@RequestParam(value = "applicantEmall", required = false) String applicantEmall,
			@RequestParam(value = "applicantIdCard", required = true) String applicantIdCard,
			@RequestParam(value = "applicantName", required = true) String applicantName,
			@RequestParam(value = "applicantPhone", required = true) String applicantPhone,

			@RequestParam(value = "recipientAddress", required = true) String recipientAddress,
			@RequestParam(value = "recipientEmall", required = false) String recipientEmall,
			@RequestParam(value = "recipientIdCard", required = true) String recipientIdCard,
			@RequestParam(value = "recipientName", required = true) String recipientName,
			@RequestParam(value = "recipientPhone", required = true) String recipientPhone,

			@RequestParam(value = "recognizeeAddress", required = true) String recognizeeAddress,
			@RequestParam(value = "recognizeeEmall", required = false) String recognizeeEmall,
			@RequestParam(value = "recognizeeIdCard", required = true) String recognizeeIdCard,
			@RequestParam(value = "recognizeeName", required = true) String recognizeeName,
			@RequestParam(value = "recognizeePhone", required = true) String recognizeePhone);

	@RequestMapping(value = "/sign/v3/theOrder/failure", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<List<Map<String, Object>>> failure(
			@RequestParam(value = "accountToken", required = true) String accountToken);

	// 分页查询
	@RequestMapping(value = "/sign/v3/theOrder/findAllPage", method = RequestMethod.POST, produces = "application/json")
	public ApiResult<PageInfo<Map<String, Object>>> findAllPage(
			@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "startTime", required = false) String startTime,
			@RequestParam(value = "endTime", required = false) String endTime,
			@RequestParam(value = "toName", required = false) String toName,
			@RequestParam(value = "startLine", required = true) Integer startLine,
			@RequestParam(value = "endLine", required = true) Integer endLine,
			@RequestParam(value = "toState", required = false) String toState);

	@RequestMapping(value = "/sign/v3/theOrder/effectByUserId", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<List<Map<String, Object>>> effectByUserId(
			@RequestParam(value = "accountToken", required = true) String accountToken);

	@RequestMapping(value = "/sign/v3/theOrder/findByLicenceNo", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<List<Map<String, Object>>> effectByUserId(
			@RequestParam(value = "vlLicenceNo", required = true) String vlLicenceNo,
			@RequestParam(value = "accountToken", required = true) String accountToken);

	@RequestMapping(value = "/sign/v3/theOrder/hasASingleByUserId", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<List<Map<String, Object>>> hasASingleByUserId(
			@RequestParam(value = "accountToken", required = true) String accountToken);

	@RequestMapping(value = "/sign/v3/theOrder/toId", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<TheOrder> toId(@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "toId", required = true) String toId);

	// 购买
	@RequestMapping(value = "/sign/v3/theOrder/buy", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<TheOrder> buy(@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "opId", required = true) String opId);

	// 支付回调：（保险公司收到钱）
	// 回调字段：订单号、支付时间（yyyy-MM-dd HH:mm:ss）、支付状态、状态说明

	@RequestMapping(value = "/sign/v3/theOrder/payTheCallback", method = RequestMethod.POST, produces = "application/json")
	public Map<String, String> payTheCallback(
			@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "orderNumber", required = true) String orderNumber,
			@RequestParam(value = "paymentTime", required = true) String paymentTime,
			@RequestParam(value = "paymentStatus", required = true) String paymentStatus,
			@RequestParam(value = "stateThat", required = true) String stateThat,
			@RequestParam(value = "paymentType", required = true) String paymentType);

	// 承包回调：（可以出单）
	// 回调字段：订单号、时间（yyyy-MM-dd HH:mm:ss）、状态、状态说明、商业险投保单号、交强险投保单号
	@RequestMapping(value = "/sign/v3/theOrder/contractingTheCallback", method = RequestMethod.POST, produces = "application/json")
	public Map<String, String> contractingTheCallback(
			@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "orderNumber", required = true) String orderNumber,
			@RequestParam(value = "paymentTime", required = true) String paymentTime,
			@RequestParam(value = "paymentStatus", required = true) String paymentStatus,
			@RequestParam(value = "stateThat", required = true) String stateThat,
			@RequestParam(value = "paymentType", required = true) String paymentType,
			@RequestParam(value = "criNumber", required = true) String criNumber,
			@RequestParam(value = "insuranceNumber", required = true) String insuranceNumber);

	// 确认订单
	@RequestMapping(value = "/sign/v3/theOrder/OrderNumber", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<TheOrder> contractingTheCallback(
			@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "orderNumber", required = true) String orderNumber,
			@RequestParam(value = "paymentType", required = true) String paymentType);

}
